import request from "@/utils/request";

// 教学首页
export function getCourseSchedulingList(semesterId) {
  return request({
    url: "/school/manager/courseScheduling/teacher/list/" + semesterId,
    method: "get",
  });
}

//学期列表
export function getSchoolSemesterList() {
  return request({
    url: "/school/manager/schoolSemester/list",
    method: "get",
  });
}

//保存课程排序
export function saveCourseSort(teacherId,courseIds) {
  return request({
    url: `/school/teacher/teachingPage/saveCourseSort/${teacherId}/${courseIds}`,
    method: "post",
  });
}
//新增排课
export function addCourseScheduling(data) {
  return request({
    url: "/school/manager/courseScheduling",
    method: "post",
    data:data
  });
}

//编辑排课
export function updateCourseScheduling(data) {
  return request({
    url: "/school/manager/courseScheduling",
    method: "put",
    data:data
  });
}

// 课程跨学期校验
export function checkTypeAndScore(query) {
  return request({
    url: "/school/manager/courseScheduling/checkTypeAndScore",
    method: "get",
    params:query
  });
}
//删除授课班级
export function deleteCourseScheduling(id,query) {
  return request({
    url: "/school/manager/courseScheduling/" + id,
    method: "delete",
    params:query
  });
}
// 根据学期Id获取课程
export function getCourseBySemesterId(semesterId,params) {
  return request({
    url: `/school/manager/grades/getCourse/${semesterId}`,
    method: "get",
    params: params
  });
}

// 根据学期Id获取班级
export function getClassBySemesterId(semesterId,params) {
  return request({
    url: `/school/manager/grades/getClass/${semesterId}`,
    method: "get",
    params: params
  });
}
// 根据课程Id获取班级
export function getClassByCourseId(courseId,params) {
  return request({
    url: `/school/manager/grades/getClassByCourseId/${courseId}`,
    method: "get",
    params: params
  });
}

// 根据班级Id获取学生
export function getStudentByClassId(classId) {
  return request({
    url: `/school/manager/grades/getStudents/${classId}`,
    method: "get"
  });
}
// 授课班级-查询列表
export function getClassTeachingList(params) {
  return request({
    url: `/school/manager/schoolClassTeaching/list`,
    method: "get",
    params:params
  });
}


// 授课班级-新增
export function addSchoolClassTeaching(data) {
  return request({
    url: `/school/manager/schoolClassTeaching`,
    method: "post",
    data:data
  });
}

// 授课班级-修改
export function editSchoolClassTeaching(data) {
  return request({
    url: `/school/manager/schoolClassTeaching`,
    method: "put",
    data:data
  });
}

// 授课班级-获取详细信息
export function getSchoolClassTeachingInfo(classTeachingId) {
  return request({
    url: `/school/manager/schoolClassTeaching/info/${classTeachingId}`,
    method: "get",
  });
}

// 授课班级-删除
export function deleteSchoolClassTeaching(classTeachingId) {
  return request({
    url: `/school/manager/schoolClassTeaching/${classTeachingId}`,
    method: "delete",
  });
}

// 获取课程主讲教师和辅助教师列表
export function getCourseTeacherList(params) {
  return request({
    url: `/school/manager/course/courseTeacherList`,
    method: "get",
    params:params
  });
}

// 授课班级-授课班级下拉列表
export function getAllSchedulingList(params) {
  return request({
    url: `/school/manager/courseScheduling/schedulingList`,
    method: "get",
    params:params
  });
}

// 添加助教
export function setAssistant(data) {
  return request({
    url: `/school/manager/courseScheduling/setAssistant`,
    method: "put",
    data:data
  });
}

// 获取班级列表(新增编辑排课)
export function getSchedulingClassList(params) {
  return request({
    url: `/school/manager/courseScheduling/getSchedulingClassList`,
    method: "get",
    params:params
  });
}
// 获取学生列表(新增编辑排课)
export function getSchedulingStudentList(params) {
  return request({
    url: `/school/manager/courseScheduling/getSchedulingStudentList`,
    method: "get",
    params:params
  });
}

// 查询学校历史学期列表
export function getHistoryList(params) {
  return request({
    url: `/school/manager/schoolSemester/historyList`,
    method: "get",
    params:params
  });
}

// 取历史课程排课列表
export function getHistorySchedulingList(historySemesterId,params) {
  return request({
    url: `/school/manager/courseScheduling/historySchedulingList/${historySemesterId}`,
    method: "get",
    params:params
  });
}

// 给排课添加学期
export function addSemesterByHistory(data) {
  return request({
    url: `/school/manager/courseScheduling/addSemester`,
    method: "put",
    data:data
  });
}

// 排课-获取排课信息
export function getCourseSchedulingInfo(schedulingId) {
  return request({
    url: `/school/manager/courseScheduling/getInfo/${schedulingId}`,
    method: "get",
  });
}

// 获取排课下学生列表
export function getStudentListByScheduling(schedulingId,params) {
  return request({
    url: `/school/manager/courseScheduling/getStudentListByScheduling/${schedulingId}`,
    method: "get",
    params:params
  });
}

// 获取排课下班级列表
export function getClassListByScheduling(schedulingId) {
  return request({
    url: `/school/manager/courseScheduling/getClassListByScheduling/${schedulingId}`,
    method: "get",
  });
}

// 获取教师未批改考核/作业数量
export function getTeacherUnMarkNum(params) {
  return request({
    url: `/school/manager/courseScheduling/teacherUnMarkNum`,
    method: "get",
    params:params
  });
}
